

export function getScreenInfo() {
    const screenInfo = {
        width: window.screen.width,
        height: window.screen.height,
        availWidth: window.screen.availWidth,
        availHeight: window.screen.availHeight,
        colorDepth: window.screen.colorDepth,
        pixelDepth: window.screen.pixelDepth,
        deviceXDPI: window.screen.deviceXDPI,
        deviceYDPI: window.screen.deviceYDPI,
        logicalXDPI: window.screen.logicalXDPI,
    }
    return screenInfo
}


export function getSystemVersion() {
    const userAgent = navigator.userAgent;
    let systemVersion = '';

    if (/Mac/i.test(userAgent)) {
        // Mac OS
        systemVersion = 'Mac OS';
        if (/OS X 10\.\d+/i.test(userAgent)) {
            systemVersion += ' ' + userAgent.match(/OS X 10\.\d+/i)[0];
        }
    } else if (/Windows NT \d\.\d/i.test(userAgent)) {
        // Windows
        systemVersion = 'Windows';
        switch (userAgent) {
            case /Windows NT 10\.0/i.test(userAgent):
                systemVersion += ' 10';
                break;
            case /Windows NT 6\.3/i.test(userAgent):
                systemVersion += ' 8.1';
                break;
            case /Windows NT 6\.2/i.test(userAgent):
                systemVersion += ' 8';
                break;
            case /Windows NT 6\.1/i.test(userAgent):
                systemVersion += ' 7';
                break;
            case /Windows NT 6\.0/i.test(userAgent):
                systemVersion += ' Vista';
                break;
            case /Windows NT 5\.1/i.test(userAgent):
                systemVersion += ' XP';
                break;
            case /Windows NT 5\.0/i.test(userAgent):
                systemVersion += ' 2000';
                break;
        }
    } else if (/Android/i.test(userAgent)) {
        // Android
        systemVersion = 'Android ' + userAgent.match(/Android (\d+\.\d+)/)[1];
    } else if (/iPhone|iPad|iPod/i.test(userAgent)) {
        // iOS
        systemVersion = 'iOS ' + userAgent.match(/OS (\d+)_/)[1];
    } else if (/Linux/i.test(userAgent)) {
        // Linux
        systemVersion = 'Linux';
    }

    return systemVersion;
}

console.log(getSystemVersion());







